#ifndef __CPU_H__
#define __CPU_H__
#include <common.h>
#include <Vtop__Syms.h>

typedef struct CPU_state {
  uint64_t rf[32];
  uint64_t pc;
  
} CPU_state;

extern CPU_state cpu;
extern const char *regs[];
extern Vtop *dut;
extern vluint64_t sim_time;

static inline int check_reg_idx(int idx) {
  IFDEF(CONFIG_RT_CHECK, assert(idx >= 0 && idx < 32));
  return idx;
}
#define rf(idx) (cpu.rf[check_reg_idx(idx)])
void reg_display();

#define CPU_RESET_TIME 5

#else
#endif